import React, { useState } from 'react';
// 一个函数返回一段jsx 
const App = () => {
  let [name, setName] = useState('郑灿苗');
  /* console.log(name,setName); */
  let [data, setDate] = useState(new Date().toLocaleTimeString())//解构
  /*  console.log(useState(1)); */
  setInterval(() => {
    setDate(new Date().toLocaleTimeString())
  }, 1000);

  const changeEnglish = () => {
    setName('dada')
  }
  return (
    <div>
      <h1>hello {name}</h1>
      <h2>显现在{data}</h2>
      <button onClick={changeEnglish}>切换英文</button>
    </div>
  )
}
export default App
